<?php

include $_SERVER['DOCUMENT_ROOT']."/lib/start.php";

check_session();
check_permission(ADM_PERM);

header("Content-type: text/plain");

$uname = trim($_POST['nick']);

$sel_uname = "SELECT uid, 'utenti' FROM utenti WHERE username = '$uname' UNION SELECT id_alunno, 'alunno' from alunni WHERE username = '$uname'";
$res_uname = $db->executeQuery($sel_uname);
if($res_uname->num_rows > 0)
	print "KO";
else
	print "OK";
exit;

?>